Skip to content

feat(optimization): persist and revalidate field envelope evidence - #4312

Merged
EvenSol merged 8 commits into
masterfrom
codex/4188-persistent-envelope-handoff
Oct 15, 2026
Merged

EvenSol merged 8 commits into
masterfrom
codex/4188-persistent-envelope-handoff

Conversation

@EvenSol

@EvenSol EvenSol commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Ready for independent review — 2026-10-15

Exact head e2f06ce756f05b5b55048750cec58876eb138f08 now passes all ten published workflows and all 22 Build/Test/Javadoc jobs, including Java 8 on Ubuntu and Windows. Its #4333/#4328/#4326 prerequisites are merged. Marked ready for review at the user's request for ordered integration; no source changes or new independent approval are claimed. The accountable owner/domain and serialized-contract reviews described below remain required before merge. Earlier statements to keep draft pending CI are historical.


Master integration — 2026-10-15

Integrated head e2f06ce756f05b5b55048750cec58876eb138f08 incorporates master a346faa1f13adfc95c99dff18e90a348d8725d28; verified tree 94c461161424d71a528ee1a075bf25f86a173501. Resolved independent task-log insertions by retaining both histories and regenerated the coverage inventory. The proposal guard and replay behavior were tested against the merged compressor changes.

Validation: 6 Java integration tests and 68 Python tests passed, zero failures. Stable direct formatting, both hook stages, documentation search, regenerated coverage/check and whitespace checks passed. Documentation impact: retained the existing implementation guides and task-log entries from both branches; no new API, physics or tolerance change is introduced by this integration. Earlier evidence below applies to its recorded checkpoints. Integration follows the user's explicit instruction to merge in dependency order; new-head hosted CI is tracked separately.


Coordination and merge gates — 2026-10-14

Reviewed published head: ac80719e08d28d39d5890da94cbc5967382ee685.

The resume/current-guard repair is now published. It restores frozen user restrictions, reruns cheap validation on resume and binds ledger publication to the exact proposals accepted by the current guard. All 13 new regressions fail the prior head; the repaired production/continuous/living suites pass 99 tests with one existing optional-DOCX skip. Mandatory local gates and independent technical re-review pass. Fresh hosted CI is still running; prior-head dependency failures do not qualify this new head.

Require process/engineering owner coverage, independent maintainer review of serialized evidence and old-reader compatibility, and independent engineering-domain review of advice acceptance/invalidation. A qualified independent maintainer may cover both independent roles. Added JSON evidence fields alone do not automatically require an NRC: existing opportunity statuses and requires_approval remain. Record whether the current/stale evidence semantics establish a new governed approval/lifecycle contract; if so, an accepted NRC is required. Agent review is not human approval.

Integration: Prefer corrected #4328 → #4326 → this repaired PR. Keep exact action/vector replay and early evidence invalidation; do not duplicate compressor physics or introduce another ledger.


Summary

Advance #4188 under #3154 by carrying accepted-point operating-envelope evidence through the existing #4187 continuous-task guard and append-only ledger, invalidating it whenever the field/host operating definition changes, and revalidating only from a newly replayed safe point.

  • bind ordered accepted action identifiers and values exactly to proposal setpoints;
  • fail closed on stale/mismatched optimizer evidence, malformed or duplicate slices, incomplete point recovery, inconsistent counts/runtime provenance, and a failed guard;
  • map production/injection route line-ups, controlled reservoir boundaries, mapped rotating-equipment power, common-shaft speed/power, driver limits, shared host-power limits, and other operating limits into the existing evidence graph;
  • supersede stale unfinished advice before replacement evaluation;
  • preserve revalidation_of lineage through unsafe cycles that intentionally produce no proposal;
  • expose current/stale evidence in the Living Report;
  • reuse merged feat(field): switch canonical route configurations #4314/feat(field): exercise live injection route configurations #4317 route and reservoir ownership plus feat(field): integrate mapped rotating equipment power #4322 mapped-power aggregation without adding another model, solver, constraint system, or store.

Added on the current head

The combined ten-well field-to-facility acceptance case now includes a configured curve-backed injection utility on the canonical field-network graph. Its solved power is included by ProcessModel.getPower(...) beside both compressor casings, and the existing shared-resource evidence cross-checks the exact area total.

Accepted-point evidence now carries three complete slices: choke, reversible separator-pressure routing, and host/shared-power response. Every point must restore and reconverge the baseline and retain finite available shared-power evidence.

The persistent acceptance workflow versions mapped network power, common-shaft power/speed, driver limit, and shared plant power limit. A non-finite mapped demand or power-limit breach invalidates the incumbent and yields no replacement; a later safe limit creates fresh evidence and resumes the prior lineage.

Safety and engineering behavior

Envelope-backed advice is accepted only when cycle identity, embedded optimizer evidence, ordered actions, finite setpoints, slice identities/axes, requested/completed points, state restoration, baseline reconvergence, evaluation counts, runtime totals, and advisory status reconcile.

Route selectors remain discrete process actions. Reservoir pressure remains a model input owned by WellFlow.ReservoirLayer. Pump/compressor charts and solved power remain owned by the canonical network/equipment and ProcessModel implementations. No physical constraint, tolerance, convergence, map, fracture, restoration, replay, or power limit is weakened.

Failed-cycle repair and integration — 2026-10-14

Previous repair head: 2ad11a044af88c67375ea8d0f4925b9ac9e7af5f
Previous tested/published tree: cf37841517f808cec317d007960e1ca00e0011c2
Parents: previous PR head d469208 and current master d28b180.

The review reproduced a defect: after an operating-definition change, a malformed optimizer proposal or optimizer exception could fail the guard, skip ledger publication, and leave the previous advice marked current. Four of the new regression cases failed on the old implementation.

Invalidation now runs in the evidence stage before model/optimizer/guard execution, and when restoring evidence on resume. It marks historical evidence non-current, supersedes eligible unfinished advice, remains idempotent across retries, preserves fresh replacements when resuming, and leaves persisted state unchanged in a dry run. The guard still controls creation of new advice. Custom plans must retain evidence-first ordering; the ledger fallback alone cannot invalidate early if a guard failure skips that stage.

Integration preserves master's renamed workflows, Maven configuration and shared evidence-source fixture. The original Java implementation is unchanged by this repair. The branch has no remaining Git merge conflicts.

Resume-safety repair — 2026-10-14

An interruption after a completed guard could restore the optimizer's original proposals while skipping the filtering and frozen user restrictions that made them safe. Resume now reuses expensive model/optimizer work, restores the cycle's frozen inputs, and reruns gates, constraints and guard before ledger publication. Missing or malformed input checkpoints block advice.

The ledger binds publication to the exact proposal content accepted by the current-cycle guard. Old-cycle approvals, post-guard setpoint mutations, and removal of evidence fields cannot revive rejected advice. No model, solver, store, constraint tolerance, or physical operating limit is added or weakened.

Current head: ac80719e08d28d39d5890da94cbc5967382ee685
Exact tested and published tree: ac3b381cf271c62c73927108af197e3b1c8ca2e5

Validation and integration

  • Thirteen new regression cases fail the previous 2ad11a0 implementation; repaired continuous/production/living suites: 99 passed, 1 existing optional DOCX skip.
  • Independent agent technical re-review reproduced rejection of stale, mutated and evidence-stripped proposals and acceptance of an unchanged detached copy. This is not a human maintainer approval.
  • Direct Spotless apply/check, both all-files pre-commit stages, documentation search (788 Markdown pages and one HTML), unchanged generated engineering inventory and whitespace checks pass.
  • Earlier broader Java and workflow results remain historical evidence for their tested commits; they are not represented as validation of this new head.

Fresh hosted CI and the applicable independent domain/maintainer review are pending. Keep draft. Preferred process integration order is #4328 → #4326 → #4312 so persistent advice consumes qualified network and compressor results. #4328's companion repair now rejects an unsuccessful or non-finite mapped compressor solve.

Documentation impact

Updated the continuous-task guide, external-optimizer integration guide, and continuous-improvement skill for mapped network power, common-shaft/driver/shared-power definition changes, fail-closed invalidation, and lineage recovery. The merged #4322 SURF guide remains the canonical map/power integration reference.

The failed-cycle repair and integration are recorded in docs/development/TASK_LOG.md. The guides and continuous-improvement skill now explain early invalidation, recovery/resume behavior, dry runs and the ordering required for custom plans.

Coordination and scope boundary

Next dependency

After review/merge, extend the same exact-head contract across lifecycle/time slices where separator/scrubber capacity and qualified compressor-map/driver/shared-power bottlenecks move. Keep map qualification with #4146–#4148, network physics with #4228, and measured execution performance with #2939.

Refs #4188, #3154, #4187, #2939, #4146, #4147, #4148, #4228, #4314, #4317, #4322.

Coordinated integration dependency

Use #4333 → #4328 → #4326 → this PR for the process/optimizer lane. #4333 isolates the shared mixing-rule accumulator race; #4326 is stacked on it. Preserve this PR's evidence/resume checks and requalify its final integrated head after those process changes. CI and the accountable reviews under GOVERNANCE.md remain merge gates.

Bind merged accepted-point operating-envelope evidence to the existing
continuous-task production guard and append-only ledger. Validate cycle,
optimizer, ordered actions/setpoints, complete unique slices, safe model
recovery, and aggregate provenance fail-closed before accepting advice.

Expose ordered action identities from the Java evidence exporter, extend
the synthetic field acceptance workflow and Python guard coverage, and
document the persistent handoff.

Refs #4188, #3154, #4187, #2939.
Invalidate accepted-point envelope evidence after route or operating-limit revisions, rerun only the declared dependency chain, and persist a replacement only after the existing production guard accepts fresh evidence. Expose current/stale evidence in the living report and cover #4314 route configuration changes plus fail-closed guard behavior.

Refs #4188, #3154, #4187, #2939
@EvenSol EvenSol changed the title feat(optimization): persist accepted-point envelope evidence feat(optimization): persist and revalidate field envelope evidence Oct 13, 2026
Consume the canonical live injection route and reservoir-boundary contract from #4317 in the persistent field workflow. Revalidate production and injection line-ups plus lifecycle pressure changes, withhold invalid intermediate configurations, and reconnect a later safe proposal to the latest superseded incumbent.

Refs #4188, #3154, #4187, #2939, #4228
… in CI

Replace environment-dependent agent assumptions with a temporary synthetic catalog exercised through real discovery and parsing. Cover absent/plugin-only catalogs, aliases, malformed and duplicate cues, and invalid evidence status.

Run the production-envelope and persistent-ledger regression suite in the Devtools workflow. Record the repair in the task log.
EvenSol added a commit that referenced this pull request Oct 14, 2026
Reuse the hermetic evidence catalog fixture from PR #4312 and the verified eight-shard slow-test partition from PR #4328. Preserve legacy required-check contexts with fail-closed aggregate gates, retain Surefire reports and allow both fast-test platforms to finish.

Include production guard regressions in the renamed Devtools workflow, fix the documentation hook filename filter, and document partitioning, measured runner wall times, and compatibility.
@EvenSol EvenSol mentioned this pull request Oct 14, 2026
EvenSol added a commit that referenced this pull request Oct 14, 2026
Port the identical hermetic evidence-source fixture from PR #4315 commit 5a48909 (originally repaired in PR #4312). Exercise real agent discovery with synthetic installed and plugin catalogs, including missing and malformed declarations.

Fixes the inherited Devtools CI failure without changing production routing or numerical code. Exact workflow validation: 314 passed, 12 skipped, 48 subtests passed; 3 mesh tests and report integration passed. Spotless, documentation, coverage and both pre-commit stages passed.

Documentation impact: none; only test inputs and isolation change.
EvenSol added a commit that referenced this pull request Oct 14, 2026
* Update GitHub Actions workflows and documentation references

- Renamed workflow files for clarity and consistency, updating references in various documentation files.
- Adjusted pre-commit configuration to reflect new workflow names.
- Enhanced AGENTS.md and CONTRIBUTING.md with guidelines on workflow naming conventions.
- Updated README.md and index.md to link to the correct CI build badges.
- Modified devtools scripts to align with new workflow names.
- Revised documentation on task quality gates and NIP issue tracking to reference updated workflows.
- Ensured all references to workflows in the documentation are consistent with the new naming scheme.

* chore: filter only pom*.xml

* add cantera as dependency

* fix publishing

* revert

* chore: update python 3.12 -> 3.13

* feat: Update GitHub workflows and documentation

- Renamed the publish NeqSim image workflow for clarity.
- Added a new workflow for publishing packages to Maven Central.
- Introduced a workflow for building and pushing the prebuild dev container.
- Updated references in the pre-commit configuration for documentation search coverage.
- Changed CI badge links in the README and index files to reflect updated workflow names.
- Updated documentation to reflect changes in workflow names and paths.
- Fixed references to workflows in various documentation files related to MCP protocol tests.
- Updated the daily research scan workflow name and references in the paper lab tests.
- Adjusted Java test cases to align with new workflow names.

* fix(ci): isolate routing tests and preserve complete validation evidence

Reuse the hermetic evidence catalog fixture from PR #4312 and the verified eight-shard slow-test partition from PR #4328. Preserve legacy required-check contexts with fail-closed aggregate gates, retain Surefire reports and allow both fast-test platforms to finish.

Include production guard regressions in the renamed Devtools workflow, fix the documentation hook filename filter, and document partitioning, measured runner wall times, and compatibility.

---------

Co-authored-by: Even Solbraa <41290109+EvenSol@users.noreply.github.com>

EvenSol commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Portfolio review found a reproduced current-head blocker at d469208: after a safe cycle creates a proposal with evidence_current=true, reducing the shared plant power limit from 1200 kW to 1 kW and returning malformed optimizer output ({"proposals":[5]}) produces guard=fail and ledger=skipped. The old proposal remains current in the ledger and Living Report. Green CI does not cover this existing-incumbent failure path.

A repair is underway on this existing branch: invalidate persisted evidence independently of successful guard execution, retain the guard preventing unchecked new proposals, and add the two-cycle regression. The repair also integrates master d28b180 (merged #4315/#4274), retaining the canonical hermetic evidence fixture and renamed CI workflows. This PR remains draft; independent review and CI on the repaired head are required before merge.

Invalidate incumbents at evidence assessment and restore before optimizer or guard failures can skip ledger publication. Keep replacement proposals guarded, repeated invalidation idempotent, dry runs read-only, and resumed current-cycle evidence intact. Cover failed guards and optimizer exceptions for proposed, accepted and implemented advice, recovery lineage, dry runs and resume.

Integrate current master, preserving renamed workflows and shared CI repairs. Document custom-plan evidence-first ordering.

Validation: exact Devtools pytest list 358 passed, 12 skipped, 48 subtests passed; adjacent continuous suites 87 passed; mesh unittest 3 passed; report integration passed; Maven bootstrap/validate, direct Spotless apply/check, pre-commit/pre-push, documentation search, engineering coverage and diff checks passed.

Tested tree: cf37841. Full merged-tree Java CI pending.

EvenSol commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

The reproduced stale-evidence defect is now repaired and published at 2ad11a044af88c67375ea8d0f4925b9ac9e7af5f (tested tree cf37841517f808cec317d007960e1ca00e0011c2). Invalidation precedes optimizer/guard execution and is restored on resume; failed cycles cannot leave the prior advice current. Added tests cover malformed results and exceptions across proposed/accepted/implemented records, plus dry runs and resume after replacement publication. Four new cases failed on the previous implementation; all pass with the repair.

The exact Devtools workflow suite passed: 358 tests, 12 skipped, 48 subtests; direct formatting, docs, coverage and both hook gates passed. The branch includes master d28b180, preserves its workflow/POM/shared-fixture updates, and is mergeable. Current-head CI and independent domain review remain required before merging; draft status is retained. Details and the custom-plan ordering boundary are in the updated PR description.

EvenSol added a commit that referenced this pull request Oct 15, 2026
…ansfer (#4282)

* feat(pipeline): add experimental non-equilibrium film transfer for #4281

* test: isolate evidence routing from optional enterprise catalogs

Port the identical hermetic evidence-source fixture from PR #4315 commit 5a48909 (originally repaired in PR #4312). Exercise real agent discovery with synthetic installed and plugin catalogs, including missing and malformed declarations.

Fixes the inherited Devtools CI failure without changing production routing or numerical code. Exact workflow validation: 314 passed, 12 skipped, 48 subtests passed; 3 mesh tests and report integration passed. Spotless, documentation, coverage and both pre-commit stages passed.

Documentation impact: none; only test inputs and isolation change.
@EvenSol
EvenSol marked this pull request as ready for review October 15, 2026 04:21
@EvenSol
EvenSol marked this pull request as draft October 15, 2026 06:00
@EvenSol
EvenSol marked this pull request as ready for review October 15, 2026 13:58
@EvenSol
EvenSol merged commit e726239 into master Oct 15, 2026
41 checks passed
@EvenSol
EvenSol deleted the codex/4188-persistent-envelope-handoff branch October 15, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant